#cd /disk2/data/proc/l1proc/20221203
ra=$1
dec=$2
error=$3  #arcsec
filter=$4
findps1.py $ra $dec $error  >res1
sed -n '6,10000p' res1 | awk '{print($1, $2, $7,$8,$14,$15,$21,$22)}' >res2
if [ "$filter"x  == 'r'x ]
then
	cat res2 | awk '{print($1,$2,$5)}' >ps1.txt
elif [ "$filter"x == 'g'x   ]
then
	cat res2 | awk '{print($1,$2,$3)}' >ps1.txt
elif [ "$filter"x == 'i'x   ]
then
	cat res2 | awk '{print($1,$2,$7)}' >ps1.txt

fi
echo "output is ps1.txt"
